using System.Windows;
using Application.Repositories;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;

namespace Application.Installers
{
    public class DefaultInstaller : IWindsorInstaller
    {
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.Register(
                Component
                    .For<IRepository<Product>>()
                    .ImplementedBy<ProductRepository>());

            container.Register(
                Component
                    .For<IMainWindowViewModelFactory>()
                    .ImplementedBy<MainWindowViewModelFactory>());

            container.Register(
                Component
                    .For<Window>()
                    .ImplementedBy<MainWindow>());
            container.Register(
                Component
                    .For<IWindow>()
                    .ImplementedBy<MainWindowAdapter>());
        }
    }
}